package io.github.lee.app.unsplash.repository.domain

import android.os.Parcelable
import androidx.annotation.Keep

import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

const val DEFAULT_BLUR_HASH = "LEHV6nWB2yk8pyo0adR*.7kCMdnj"

@Keep
@Parcelize
data class Photo(
    @SerializedName("alt_description")
    var altDescription: String? = "",
    @SerializedName("blur_hash")
    var blurHash: String = DEFAULT_BLUR_HASH,
    @SerializedName("color")
    var color: String? = "",
    @SerializedName("created_at")
    var createdAt: String? = "",
    @SerializedName("description")
    var description: String? = "",
    @SerializedName("height")
    var height: Int = 1,
    @SerializedName("id")
    var id: String? = "",
    @SerializedName("liked_by_user")
    var likedByUser: Boolean? = false,
    @SerializedName("likes")
    var likes: Int? = 0,
    @SerializedName("links")
    var links: Link? = null,
    @SerializedName("promoted_at")
    var promotedAt: String? = "",
    @SerializedName("slug")
    var slug: String? = "",
    @SerializedName("updated_at")
    var updatedAt: String? = "",
    @SerializedName("urls")
    var urls: PhotoUrl? = null,
    @SerializedName("user")
    var user: User? = User(),
    @SerializedName("width")
    var width: Int = 1
) : Parcelable {
    val ratio: Float
        get() {
            return width * 1.0F / height
        }
}


@Keep
@Parcelize
data class User(
    @SerializedName("accepted_tos")
    var acceptedTos: Boolean? = false,
    @SerializedName("bio")
    var bio: String? = "",
    @SerializedName("first_name")
    var firstName: String? = "",
    @SerializedName("for_hire")
    var forHire: Boolean? = false,
    @SerializedName("id")
    var id: String? = "",
    @SerializedName("instagram_username")
    var instagramUsername: String? = "",
    @SerializedName("last_name")
    var lastName: String? = "",
    @SerializedName("links")
    var links: LinksX? = LinksX(),
    @SerializedName("location")
    var location: String? = "",
    @SerializedName("name")
    var name: String? = "",
    @SerializedName("portfolio_url")
    var portfolioUrl: String? = "",
    @SerializedName("profile_image")
    var profileImage: ProfileImage? = ProfileImage(),
    @SerializedName("social")
    var social: Social? = Social(),
    @SerializedName("total_collections")
    var totalCollections: Int? = 0,
    @SerializedName("total_likes")
    var totalLikes: Int? = 0,
    @SerializedName("total_photos")
    var totalPhotos: Int? = 0,
    @SerializedName("twitter_username")
    var twitterUsername: String? = "",
    @SerializedName("updated_at")
    var updatedAt: String? = "",
    @SerializedName("username")
    var username: String? = ""
) : Parcelable

@Keep
data class DRenders(
    @SerializedName("approved_on")
    var approvedOn: String? = null,
    @SerializedName("status")
    var status: String? = null
)

@Keep
@Parcelize
data class LinksX(
    @SerializedName("followers")
    var followers: String? = null,
    @SerializedName("following")
    var following: String? = null,
    @SerializedName("html")
    var html: String? = null,
    @SerializedName("likes")
    var likes: String? = null,
    @SerializedName("photos")
    var photos: String? = null,
    @SerializedName("portfolio")
    var portfolio: String? = null,
    @SerializedName("self")
    var self: String? = null
) : Parcelable

@Keep
@Parcelize
data class ProfileImage(
    @SerializedName("large")
    var large: String? = null,
    @SerializedName("medium")
    var medium: String? = null,
    @SerializedName("small")
    var small: String? = null
) : Parcelable

@Keep
@Parcelize
data class Social(
    @SerializedName("instagram_username")
    var instagramUsername: String? = null,
    @SerializedName("paypal_email")
    var paypalEmail: String? = null,
    @SerializedName("portfolio_url")
    var portfolioUrl: String? = null,
    @SerializedName("twitter_username")
    var twitterUsername: String? = null
) : Parcelable